package com.hjt.common.exception;

/**
 * 错误码枚举类
 * @author:97007
 * @date:2021/9/11 22:25
 */
public enum ErrorCodeEnum {
    UNKNOWN_EXCEPTION(10000, "未知异常"),
    VALID_EXCEPTION(10001,"参数校验失败"),
    USER_NAME_HAS_EXISTED_EXCEPTION(15001,"用户名已存在"),
    EMAIL_HAS_REGISTERED_EXCEPTION(15002,"邮箱已被注册"),
    USERACCOUNT_PASSWD_INVALID_EXCEPTION(15002,"用户账户或密码错误"),
    PRODUCT_UP_ERROR(11000, "商品上架错误"),
    NO_STOCK_EXCEPTION(21000, "商品库存不足");

    int code;
    String message;
    ErrorCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
